//
//  AddsBookV2.m
//  OC_05_数组_字典和集合
//
//  Created by wyx on 16/3/2.
//  Copyright © 2016年 Apon. All rights reserved.
//

#import "AddsBookV2.h"

@implementation AddsBookV2
- (instancetype)init {
    self = [super init];
    if (self) {
        _mDic = [NSMutableDictionary dictionary];
        for (char c = 'A'; c <= 'Z'; c++) {
            NSMutableArray *amrr = [NSMutableArray array];
            NSString *key = [NSString stringWithFormat:@"%c",c];
            [_mDic setObject:amrr forKey:key];
        }
    }/** 思路一:初始化字典同时添加了26个键值对 */
    return self;
}
- (void)addContact2:(Contact *)contact{
    NSString *g = contact.name;
    NSMutableArray *marr = [self.mDic objectForKey:g];
    [marr addObject:contact];
}
    
@end
